home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / AppsToGo / AppsToGo.src / AppsToGo.Changes / DTS.Draw / TRRectObj.c.df < prev    next >
Encoding:
Text File  |  1993-06-18  |  6.7 KB  |  187 lines  |  [TEXT/MPS ]

  1. File #1: b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c
  2. File #2: a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c
  3.  
  4. Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line 7; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 7)
  5. ** Copyright © 1992 Apple Computer, Inc.
  6.  
  7. ** Copyright © 1992-1993 Apple Computer, Inc.
  8.  
  9.  
  10. Extra lines in 2nd before 11 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line Δ11; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 11:18)
  11. /* You may incorporate this sample code into your applications without
  12. ** restriction, though the sample code has been provided "AS IS" and the
  13. ** responsibility for its operation is 100% yours.  However, what you are
  14. ** not permitted to do is to redistribute the source as "DSC Sample Code"
  15. ** after having made changes. If you're going to re-distribute the source,
  16. ** we require that you make it clear in the source that the code was
  17. ** descended from Apple Sample Code, but that you've made changes. */
  18.  
  19.  
  20.  
  21. Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line 61:63; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 69:76)
  22.     Rect        rct;
  23.     RgnHandle    rgn;
  24.     short        w, h;
  25.  
  26.     Rect        rct, grabber;
  27.     RgnHandle    rgn;
  28.     short        w, h, oldh, oldw;
  29.     ClickInfo    *click;
  30.     TreeObjHndl    hhndl;
  31.     Point        where, pt, curMouse;
  32.     EventRecord    option;
  33.     RGBColor    rgb, rgb2;
  34.  
  35.  
  36. Extra lines in 2nd before 69 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line Δ69; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 82:86)
  37.         case INITMESSAGE:
  38.             TRectObj(hndl, message, data);
  39.             mDerefRRect(hndl)->width = mDerefRRect(hndl)->height = 20;
  40.             break;
  41.  
  42.  
  43.  
  44. Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line 77:81; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 95:98)
  45.         case HITTESTMESSAGE:
  46.         case GETBBOXMESSAGE:
  47.         case SETBBOXMESSAGE:
  48.         case SECTBBOXMESSAGE:
  49.         case TARGETMESSAGE:
  50.  
  51.         case GETOBJRECTMESSAGE:
  52.         case SETOBJRECTMESSAGE:
  53.         case SECTOBJRECTMESSAGE:
  54.         case GETBBOXMESSAGE:
  55.  
  56.  
  57. Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line 86; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 103)
  58.         case SIZEMESSAGE:
  59.  
  60.         case COMPAREMESSAGE:
  61.  
  62.  
  63. Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line 90:92; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 107:136)
  64.         case INITMESSAGE:
  65.             TRectObj(hndl, message, data);
  66.             mDerefRRect(hndl)->width = mDerefRRect(hndl)->height = 20;
  67.  
  68.         case HITTESTMESSAGE:
  69.             click = (ClickInfo *)data;
  70.             hhndl = (TreeObjHndl)TRectObj(hndl, message, data);
  71.                 /* We must call TRectObj::HITTESTMESSAGE to set some static
  72.                 ** variables that TRectObj::SELECTOBJMESSAGE uses. */
  73.             if ((!hhndl) && (click->message == HITTESTGRABBER)) {
  74.                 if (mDerefRoot(GetRootHndl(hndl))->numSelected == 1) {
  75.                     if (mDerefRRect(hndl)->selected) {
  76.                         rct   = mDerefRRect(hndl)->rect;
  77.                         where = click->localEvent.where;
  78.                         if (PtInRect(where, &rct)) {
  79.                             GetMouse(&curMouse);
  80.                             grabber.top  = pt.v = (rct.top  + (mDerefRRect(hndl)->height / 2));
  81.                             grabber.left = pt.h = (rct.left + (mDerefRRect(hndl)->width / 2));
  82.                             grabber.bottom = (grabber.top  -= 3) + 6;
  83.                             grabber.right  = (grabber.left -= 3) + 6;
  84.                             if (PtInRect(where, &grabber)) {
  85.                                 click->localEvent.where = pt;
  86.                                 click->offset.h         = pt.h - curMouse.h;
  87.                                 click->offset.v         = pt.v - curMouse.v;
  88.                                 click->oldFlip          = 0;
  89.                                 click->newFlip          = 0;
  90.                                 click->grabber          = 7;
  91.                                 hhndl = hndl;
  92.                             }
  93.                         }
  94.                     }
  95.                 }
  96.             }
  97.             return((long)hhndl);
  98.  
  99.  
  100. Nonmatching lines (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line 106:111; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 150:172)
  101.             w   = mDerefRRect(hndl)->width;
  102.             h   = mDerefRRect(hndl)->height;
  103.             switch (data) {
  104.                 case DRAWOBJ:
  105.                     FillRoundRect(&rct, w, h, (ConstPatternParam)&qd.white);
  106.                     FrameRoundRect(&rct, w, h);
  107.  
  108.             h   = mDerefCommon(hndl)->penHeight;
  109.             w   = mDerefCommon(hndl)->penWidth;
  110.             PenSize(w, h);
  111.             w = mDerefRRect(hndl)->width;
  112.             h = mDerefRRect(hndl)->height;
  113.             switch (data) {
  114.                 case DRAWOBJ:
  115.                     if (gQDVersion)
  116.                         GetForeColor(&rgb);
  117.                     ForeColor(whiteColor);
  118.                     if (gQDVersion) {
  119.                         rgb2 = mDerefLine(hndl)->contentColor;
  120.                         RGBForeColor(&rgb2);
  121.                     }
  122.                     PaintRoundRect(&rct, w, h);
  123.                     ForeColor(blackColor);
  124.                     if (gQDVersion) {
  125.                         rgb2 = mDerefLine(hndl)->borderColor;
  126.                         RGBForeColor(&rgb2);
  127.                     }
  128.                     FrameRoundRect(&rct, w, h);
  129.                     if (gQDVersion)
  130.                         RGBForeColor(&rgb);
  131.  
  132.  
  133. Extra lines in 2nd before 118 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line Δ118; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 179:185)
  134.                     if (mDerefCommon(hndl)->selected) {
  135.                         grabber.top  = rct.top  + (h / 2);
  136.                         grabber.left = rct.left + (w / 2);
  137.                         grabber.bottom = (grabber.top  -= 3) + 6;
  138.                         grabber.right  = (grabber.left -= 3) + 6;
  139.                         InvertRect(&grabber);
  140.                     }
  141.  
  142.  
  143. Extra lines in 1st before 190 in 2nd (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line 122; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line Δ190)
  144.                     PenNormal();
  145.  
  146.  
  147. Extra lines in 2nd before 128 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line Δ128; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 195)
  148.             PenNormal();
  149.  
  150.  
  151. Extra lines in 2nd before 163 in 1st (File "b:-archives:93/03/25.Dev.CD.Version:AppsToGo.CD:DTS.Draw:TRRectObj.c"; Line Δ163; File "a:Desktop Folder:AppsToGo.src:DTS.Draw:TRRectObj.c"; Line 231:262)
  152.         case SIZEMESSAGE:
  153.             click = (ClickInfo *)data;
  154.             if (click->grabber != 7)
  155.                 return(TRectObj(hndl, message, data));
  156.  
  157.             DoTreeObjMethod(hndl, GETOBJRECTMESSAGE, (long)&rct);
  158.             oldw = mDerefRRect(hndl)->width;
  159.             oldh = mDerefRRect(hndl)->height;
  160.  
  161.             GetMouse(&curMouse);
  162.             curMouse.h += click->offset.h;
  163.             curMouse.v += click->offset.v;
  164.             w = (curMouse.h - rct.left) * 2;
  165.             h = (curMouse.v - rct.top) * 2;
  166.             if (w < 10) w = 10;
  167.             if (h < 10) h = 10;
  168.             if (w > (rct.right  - rct.left)) w = rct.right  - rct.left;
  169.             if (h > (rct.bottom - rct.top))  h = rct.bottom - rct.top;
  170.  
  171.             OSEventAvail(nullEvent, &option);
  172.             if (option.modifiers & shiftKey) {
  173.                 if (w > h) w = h;
  174.                 if (h > w) h = w;
  175.             }
  176.             if ((w != oldw) || (h != oldh)) {
  177.                 mDerefRRect(hndl)->width  = w;
  178.                 mDerefRRect(hndl)->height = h;
  179.                 return(true);
  180.             }
  181.             return(false);
  182.             break;
  183.  
  184.  
  185.  
  186. *** EOF on both files at the same time ***
  187.